﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Lookstone.Data
{
	public static class NullableField
	{
		public static object ToNullableValue<T>(T value)
		{
			if (value == null)
				return DBNull.Value;

			return value;
		}

		public static object ToNullableValue<T>(T? value) where T : struct
		{
			if (!value.HasValue)
				return DBNull.Value;

			return value;
		}
	}
}
